package com.container.app.testclasses.movies;

import com.container.app.annotations.Component;
import com.container.app.annotations.ImplementationTag;
import com.container.app.annotations.Inject;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Georgiana.Scarlat
 * Date: 7/11/12
 * Time: 5:35 PM
 */
@SuppressWarnings("UnusedDeclaration")
@Component
public class MovieLister implements AbstractMovieLister {

    MovieFinder finder;

    @Inject
    public void setFinder(@ImplementationTag("chosen implementation") MovieFinder finder) {
        this.finder = finder;
    }


    public String listMovies() {
        String moviesList = "Movies: ";
        List movies = finder.find();
        for (Object o : movies)
            moviesList += o.toString() + " ";

        return moviesList;
    }
}
